#ifndef __IO_DYNAMICLENGTHSERIALIZER_H__
#define __IO_DYNAMICLENGTHSERIALIZER_H__

#include "DynamicLengthPool.h"

class CDynamicLengthSerializer : public ISerializer
{
public:
	CDynamicLengthSerializer(std::vector<char> & rVec, bool bWriteMode);
	virtual ~CDynamicLengthSerializer(void);
public:
	virtual bool IsWriteMode();

	virtual void Serialize(bool & rBoolData);
	virtual void Serialize(char & rCharData);
	virtual void Serialize(unsigned char & rUCharData);
	virtual void Serialize(short & rShortData);
	virtual void Serialize(unsigned short & rUShortData);
	virtual void Serialize(int & rIntData);
	virtual void Serialize(unsigned int & rUIntData);
	virtual void Serialize(__int64 & rInt64Data);
	virtual void Serialize(unsigned __int64 & rUInt64Data);
	virtual void Serialize(float & rFloatData);
	virtual void Serialize(double & rDoubleData);

	virtual void Serialize(std::string & rStrData);
	virtual void Serialize(char * pData, int nSize);
private:
	bool	m_bWriteMode;
	CDynamicLengthPool m_dynaPool;
};

#endif //__IO_DYNAMICLENGTHSERIALIZER_H__
